# Contributor: Adam Plumb <adamplumb@gmail.com>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=libadwaita
pkgver=1.6.1
pkgrel=0
pkgdesc="Building blocks for modern GNOME applications"
url="https://gitlab.gnome.org/GNOME/libadwaita"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	appstream-dev
	fribidi-dev
	glib-dev
	gobject-introspection-dev
	gtk4.0-dev
	meson
	sassc
	vala
	"
# Tests need any font
checkdepends="
	dbus
	font-dejavu
	mesa-dri-gallium
	xvfb-run
	"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-lang $pkgname-demo"
source="https://gitlab.gnome.org/GNOME/libadwaita/-/archive/$pkgver/libadwaita-$pkgver.tar.gz"

build() {
	CFLAGS="$CFLAGS -g1" \
	CPPFLAGS="$CPPFLAGS -g1" \
	abuild-meson \
		-Db_lto=true \
		-Dexamples=true \
		-Dgtk_doc=false \
		. output
	meson compile -C output
}

check() {
	XDG_RUNTIME_DIR="$(mktemp -d -p "$builddir")" \
	dbus-run-session -- \
	xvfb-run -a \
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

demo() {
	pkgdesc="$pkgdesc (libadwaita demo)"
	amove usr/share usr/bin
}

sha512sums="
dc85d02b92eb4136e1233a53b38b4f1f4bc3580262699196dd672b4acd0e0e8e2801a018d25fa48c7759522ff8f1467a212a04d84808a063c90f5d1ba59327dc  libadwaita-1.6.1.tar.gz
"
